<?php

class miContentShowModule extends Module
{
    public function __construct()
    {
        Log::write('0000');
        $this->includePhp('miContentShow', 'miContentShow');
    }

    /**
     * 统一调用插件
     * @param $user     /当前用户
     * @param $method   /调用的方法
     * @param $param    /参数
     */
    public function call($user, $method, $param)
    {
        switch ($method) {
            case "getMiContentShowById":
                $id=$param->id;
                if (!isset($id)) {
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                miContentShow::getMiContentShowById($param);
                break;
            case "getContentByTagId":
                $id=$param->id;
                $miUId = $param->miUId;
                $qId = $param->qId;
                if (!isset($id) || !isset($miUId) || !isset($qId)) {
                    Log::write('errorUid:'.Session::$user['userId'].'|id:'.$id.'|miUId:'.$miUId.'|qId:'.$qId);
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                miContentShow::getContentByTagId($param);
                break;
        }
    }
}

$module = new miContentShowModule();
Module::addModule($module);